package com.e3.basdoc.region.client;

import java.util.List;

import com.e3.basdoc.region.model.RegionModel;
import com.e3.basdoc.region.model.RegionQC;
import com.e3.web.core.client.RPCServiceHelper;
import com.e3.web.core.client.WebException;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;

/**
 * Description: <br>
 * 
 * @author: <a href="mailto:senton1101@126.com">TianXiangdong</a> 2010-8-6
 */
public interface RegionRPCService extends RemoteService {

	public static class Util {

		private static RegionRPCServiceAsync instance;

		public static RegionRPCServiceAsync getInstance() {
			instance = (RegionRPCServiceAsync) RPCServiceHelper.getService(RegionRPCService.class.getName());
			if (instance == null) {
				instance = GWT.create(RegionRPCService.class);
				RPCServiceHelper.registerServiceEntryPoint(instance);
			}
			return instance;
		}

	}

	RegionModel newRegion(RegionModel regionModel) throws WebException;

	List<RegionModel> getRegionsByCondition(RegionQC regionQC) throws WebException;

	RegionModel modifyRegion(RegionModel regionModel) throws WebException;

	void deleteRegions(List<RegionModel> regionModels) throws WebException;

	List<RegionModel> getRegionChildren(RegionModel regionModel) throws WebException;

	RegionModel getRegionByCode(String code) throws WebException;

	RegionModel getRegionById(String id) throws WebException;
	
	PagingLoadResult<RegionModel> getPagingRegions(PagingLoadConfig config) throws WebException;

}
